<template>
  <div class="v-container">
    <v-header title="支付">
      <span class="back" @click="goBack">
        <i class="el-icon-arrow-left"></i>返回
      </span>
    </v-header>
    <div class="v-main">
      
      <div class="xc">
          <div class="fl"><span id="activityName">普通洗车</span></div>
          <div class="fr"><span class="buynum">购买数量 X 1</span></div>
          <div class="clearfix"></div>
      </div>
      <div class="col-xs-12 col-sm-12 col-md-12 tit">订单详情</div>
      <div class="col-xs-12 col-sm-12 col-md-12 jin">
          <p>支付金额</p>
          <p id="proPrice" class="price">￥8.80</p>
      </div>
      <div class="clearfix"></div>
      <div class="rongqi">
          <div id="0" v-on:click="select_type('1')" class="paystyle jg">
              <div class="fl"><span class="xiche"><img src="@/assets/images/logo_yl.png" width="35px">&nbsp;&nbsp;银联支付</span></div>
              <div class="yes fr" :class="select_data=='1'?'dui':''" ></div>
              <div class="clearfix"></div>
          </div>
          <p>*仅支持平安银行信用卡支付。</p>
          <!-- <p>&nbsp;</p>
          <div id="0" v-on:click="select_type('2')" class="paystyle jg">
              <div class="fl"><span class="xiche"><img src="@/assets/images/logo_yl.png" width="35px">&nbsp;&nbsp;银联支付</span></div>
              <div class="yes fr" :class="select_data=='2'?'dui':''" ></div>
              <div class="clearfix"></div>
          </div> -->
      </div>
      <p class="care">*抢购成功后请尽快到盛大网点使用，有效期30天。逾期失效。不支持退款。</p>


      <div class="logout">
        <mt-button class="my-button hot-button round" @click="paYsubmit">立即支付</mt-button>
      </div>
    </div>
    <div v-html="frontUP"></div>
  </div>
  
</template>


<script>
import vHeader from '@/components/Header.vue';
import { Resource } from '@/services/resource';
import Cookies from 'js-cookie';
import { staticPath } from '@/env';
import { MessageBox } from 'mint-ui';

export default {
  name: 'pay',
  components: {
    vHeader
  },
  data() {
    return {
      userInfo: {
        telphone: '',
        userName: ''
      },
      select_data:"1",//选择支付方式
      frontUP:""
    };
  },
  mounted() {
    this.getUserInfo();
      document.querySelector('body').setAttribute('style', 'background-color:#ffffff');
    
  },
  beforeDestroy() {
    document.querySelector('body').removeAttribute('style');
  },
  methods: {
    // 返回上一页
    goBack() {
      this.$router.go(-1);
    },
    // 获取用户信息
    getUserInfo() {
      Resource.getUserInfo.post({}, {}).then(res => {
        let { telphone, userName } = res.user;
        Object.assign(this.userInfo, { telphone, userName });
      });
    },
    //选择支付方式
    select_type(id){
      this.select_data=id;
    },
    // 立即支付
    paYsubmit() {
      var that=this;
      
          Resource.payConfirm.post({}, {}).then(res => {
            console.log(res);

          });
    }
  }

};
</script>

<style lang="less" scoped>
@import url('./pay.less');
</style>
